home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-04-27 | 452 b | 19 lines | [TEXT/????] |
- ;;; $Header: udefs2.scm,v 1.3 88/01/26 07:45:30 GMT gjs Exp $
-
- (if-mit
- (declare (usual-integrations = + - * /
- zero? 1+ -1+
- ;; truncate round floor ceiling
- sqrt exp log sin cos)))
-
- (define (square x) (* x x))
-
- (define (close-enuf? h1 h2 tolerance)
- (<= (abs (- h1 h2)) (* .5 tolerance (+ (abs h1) (abs h2) 2))))
-
- (define (sigma f low high)
- (let lp ((i low) (sum 0))
- (if (> i high)
- sum
- (lp (1+ i) (+ sum (f i))))))
-